package com.ruoyi.app.controller.order.mapper;

import com.ruoyi.common.core.dao.BaseMapper;
import com.ruoyi.common.entity.DO.order.OrderRefundDO;
import com.ruoyi.common.entity.VO.order.OrderRefundSearchVO;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

public interface IOrderRefundMapper extends BaseMapper<OrderRefundDO> {

    @Update("UPDATE order_refund SET refund_status=#{refundStatus},update_time=sysdate(),update_by='系统自动处理' WHERE refund_sn=#{refundSn}")
    int updateRefundStatusByRefundSn(@Param("refundSn") String refundSn, @Param("refundStatus") Integer refundStatus);

    @Select("SELECT refund_sn refundSn,refund_order_sn refundOrderSn,refund_pay_sn refundPaySn,refund_status refundStatus,refund_amount refundAmount FROM order_refund WHERE refund_sn=#{refundSn}")
    OrderRefundDO getRefundInfoByRefundSn(String refundSn);

    OrderRefundDO getRefundInfo(OrderRefundSearchVO orderRefundSearchVO);
}
